package com.umeox.watch.moto.dataservice.db.dao;

import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;

import com.umeox.watch.moto.dataservice.db.model.Fences;

import java.util.List;

/**
 * Created by Rambo 2021/9/23
 * Describe:
 */
@Dao
public interface FencesDao {

    @Query("SELECT * FROM fences WHERE id = :id")
    Fences queryById(long id);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void save(List<Fences> fencesList);

    @Query("DELETE FROM fences")
    void deleteAll();

    @Query("SELECT * FROM fences")
    List<Fences> queryAll();
}
